package naga.x.platform2.app.model;

import java.util.Date;

import com.alibaba.fastjson.JSONObject;

import naga.x.platform2.app.Channel;

public class Code {

	// table: code
	/** the unique id */
	private int id;
	/** 礼包码 */
	private String code;
	/** 状态更新时间 */
	private Date time;
	/** 礼包状态 */
	private State state;
	/** 领取该礼包的玩家id */
	private long receiver;

	// table: code_type
	/** 礼包类型 */
	private int type;
	/** 礼包内容 */
	private JSONObject content;
	/** 同一个玩家限制领取数量 */
	private int limit;
	/** 限制渠道 */
	private Channel channel;
	
	public enum State {
		AVAILABLE, // 可用
		RECEIVED,  // 已领取
		INVALID,   // 失效
	}
	
	public Code() {}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	public long getReceiver() {
		return receiver;
	}

	public void setReceiver(long receiver) {
		this.receiver = receiver;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public JSONObject getContent() {
		return content;
	}

	public void setContent(JSONObject content) {
		this.content = content;
	}

	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public Channel getChannel() {
		return channel;
	}

	public void setChannel(Channel channel) {
		this.channel = channel;
	}
	
}
